#include <stdio.h>
#include <string.h>

#define MAX 100

// 枚举常量
enum Color {
    RED,
    GREEN,
    BLUE
};

int main() {
    printf("char size %zu\n", sizeof(char));
    printf("short size %zu\n", sizeof(short));
    printf("int size %zu\n", sizeof(int));
    printf("long size %zu\n", sizeof(long));
    printf("long long size %zu\n", sizeof(long long));
    printf("float size %zu\n", sizeof(float));
    printf("double size %zu\n", sizeof(double));
    printf("--------1---------\n");
    // int a = 0;
    // int b = 0;
    // scanf("%d %d", &a, &b);
    // printf("%d\n", a + b);

    printf("max size %zu\n", sizeof(MAX));

    enum Color color = BLUE;

    printf("hello world,%d\n", color);
    printf("--------2---------\n");
    // 字符串结束标识\0
    char a1[] = "abcdefg";
    char a2[] = {'1', '2', '3', '4', '5', '6'};
    // char a2[] = {'1', '2', '3', '4', '5', '6', '\0'}; // 显式指定结束标识

    printf("%s,%llu\n", a1, strlen(a1));
    printf("%s,%llu\n", a2, strlen(a2));
    printf("--------3---------\n");
    char arr1[] = "123";
    char arr2[] = {'b', 'i', 't'};
    char arr3[] = {'a', 'b', 'c', '\0', 'd'};
    printf("%s\n", arr1);
    printf("%s\n", arr2);
    printf("%s\n", arr3);
    printf("--------4---------\n");
    printf("%c\n", '\130'); //八进制
    printf("%s\n", "\130"); //八进制
    printf("%c\n", '\x30'); //十六进制
    printf("%s\n", "\x30"); //十六进制
    printf("--------5---------\n");
    int int_a = 0;
    int arr_int[5] = {10, 10};
    printf("%d\n", arr_int[1]);
    printf("%zu\n", sizeof(arr_int));
    char arr_c[5];
    printf("%zu\n", sizeof(arr_c));
    printf("--------6---------\n");
    float a = 7.0 / 2.0;
    int b = 7 % 2;
    printf("%.1f\n", a);
    printf("%d\n", b);
    printf("--------7---------\n");
    int cc = 7 << 2;
    printf("%d\n", cc);
    printf("%zu\n", sizeof cc);
    printf("--------8---------\n");
    printf("--------9---------\n");
    printf("--------10---------\n");
    printf("--------11---------\n");
    return 0;
}
